/**
 * @brief Joystick driver header
 * @author Gilad Avidov
 */
#ifndef JOYSTICK_H_INCLUDED
#define JOYSTICK_H_INCLUDED

#define JOYSTICK_INTERRUPT_ENABLE  EX0

void joystick_init();
short joystick_get_x();
short joystick_get_y();

/* to center the joystick:
 * physically put joystick at the center and call joystick_center()
 */
void joystick_center();


/*
 * @return true if press detected
 * full name should be called: was the button pressed since the last time
 *                             that I have called ?
 */
bit joystick_button_pressed();

extern volatile bit joystick_was_pressed;

#endif // JOYSTICK_H_INCLUDED
